package com.itheima_3;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

public class AnnoDemo {
    public static void main(String[] args) throws ClassNotFoundException, IllegalAccessException, InstantiationException, InvocationTargetException {
        Class aClass = Class.forName("com.itheima_3.UseTest");
        UseTest o = (UseTest) aClass.newInstance();
        Method[] declaredMethods = aClass.getDeclaredMethods();
        for (Method declaredMethod : declaredMethods) {
            if(declaredMethod.isAnnotationPresent(Test.class)){
                declaredMethod.invoke(o);
            }
        }

    }

}
